package band.wukong.practice.javase.core.thread.basic;

import java.io.IOException;

/**
 *
 * @author wukong(wukonggg@139.com)
 * Date: 2009-11-5 14:29:47
 */
public class CurrentThreadObjRef extends Thread {

    private static int count = 0;

    public void run() {
        for (int a = 0; a < 5; a++) {
            System.out.print(currentThread().getName() + ": " + a);
            System.out.println(". count=" + count++);
            yield();
        }
    }

    public static void main(String[] args) throws IOException, InterruptedException {
        CurrentThreadObjRef m1 = new CurrentThreadObjRef();
        m1.setName("m1");
        m1.start();
        m1.run();
    }
}
